
from qiniu import Auth, put_file, etag
ACCESS_KEY = "tjpBIgAsh_Fx5qBv96hzI2mXT6EuX4kaPiQ3lbk_"
SECRET_KEY = "Q4VvzJVjd2ExM8e2D7bQE-Wl76Tl_CdX2daXiym6"


def qiniu_token(data):
    # 构建鉴权对象
    q = Auth(ACCESS_KEY, SECRET_KEY)
    bucket ='baimianxiaodetupian'
    token = q.upload_token(bucket)
    key = data
    print(key, data)
    ret, info = put_file(token, key, data)
    print(info)
    return token
